/**
 * 获取客户经理列表
 * @param {*} args
 * @returns
 */
export function get(args) {
  return RSocket.rs({
    route: 'cbv.managers',
    args: { ...args },
  });
}

/**
 * 获取客户经理数量
 * @param {*} args
 * @returns
 */
export function count(args) {
  return RSocket.rr({
    route: 'cbv.managers.count',
    args: { ...args },
  });
}

/**
 * 创建客户经理
 * @param {*} args
 * @returns
 */
export function create(data, args) {
  return RSocket.rr({
    route: 'cbv.managers.create',
    data: { ...data },
    args: { ...args },
  });
}

/**
 * 删除客户经理
 * @param {*} args
 * @returns
 */
export function remove(username) {
  return RSocket.rr({
    route: `cbv.managers.${username}.delete`,
  });
}

/**
 * 更新客户经理
 * @param {*} args
 * @returns
 */
export function update(data) {
  return RSocket.rr({
    route: 'cbv.managers.update',
    data: { ...data },
  });
}

/**
 * @description 获取指定互联网用户
 * @param {*} typeName 字典标识
 * @returns true
 */
export function getCustomerUser(username) {
  return RSocket.rr({
    route: `inetusers.${username}`,
  });
}

/**
 * @description 根据手机号获取指定互联网用户
 * @param {*} typeName 字典标识
 * @returns true
 */
export function getInetusersMobile(args) {
  return RSocket.rr({
    route: 'inetusers.mobile',
    args: { ...args },
  });
}

/* 获取cust扫码链接 */
export function addProfitShare(type, targetId, period) {
  return RSocket.rr({
    route: 'commons.profit-share-account.bind',
    args: {
      targetType: type,
      targetId,
      period,
    },
  });
}

/**
 * @func 获取字典
 */
export function getDictsItems(dictId) {
  return RSocket.rs({
    route: `dicts.${dictId}.items`,
    args: {
      search: {},
      pg: {
        size: 10,
        page: 0,
      },
    },
  });
}

/**
 * 获取接待打标列表
 * @param {*} param0
 * @returns
 */
export function getManagersInfo({ search, pg }) {
  return RSocket.rs({
    route: 'cbv.managers.reception.mark.info',
    args: {
      search,
      pg,
    },
  });
}

/**
 * 获取接待打标数量
 * @param {*} param0
 * @returns
 */
export function getManagersInfoCount({ search }) {
  return RSocket.rr({
    route: 'cbv.managers.reception.mark.info.count',
    args: {
      search,
    },
  });
}

/**
 * @description 获取包车订单数量
 * @returns true
 */
export function ordersCount({ search }) {
  return RSocket.rr({
    route: 'orders.search.count',
    args: { search },
  });
}

/**
 * 查询指定订单指定身份分润总计
 * @param { object }  search pg
 */
// eslint-disable-next-line no-shadow
export function getExcelsStatistics(args) {
  return RSocket.rr({
    route: 'cbv.excels.statistics.total.user',
    args: {
      ...args,
    },
  });
}
